package com.hundsun.cprs.yyt.service.dilivery.dao;

import com.hundsun.cprs.yyt.service.dilivery.domain.DiliveryAddress;
import com.hundsun.cprs.yyt.service.dilivery.domain.query.AddressQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface DiliveryAddressDao {
	/*
	 * 新增提货地址
	 * @param diliveryAddress
	 *
	 * */
	public void createDiliveryAddress(DiliveryAddress diliveryAddress);

	/*
	 * 修改提货地址
	 * @param diliveryAddress
	 *
	 * */
	public void modifiyDiliveryAddress(DiliveryAddress diliveryAddress);

	/*
	 * 查询个人所有的提货地址
	 * @param userId
	 * return List<DiliveryAddress>
	 *
	 * */
	public List<DiliveryAddress> selectAddressListByUserId(Long userId);

	/*
	 * 将某人的所有提货地址设置为非默认
	 * @param userId
	 *
	 * */
	public void setNoDefaultByUserId(Long userId);

	/*
	 * 根据用户id查询个人的默认地址，或者根据地址id查询地址的详细信息
	 * @param userId，addressId
	 *
	 * */
	public DiliveryAddress selectAddressByUserIdOrAddressId(@Param("userId") Long userId, @Param("addressId") Long addressId);

	public DiliveryAddress selectAddressByAddressId(Long addressId);

	public List<DiliveryAddress> queryAddressByPage(AddressQuery query);
}
